﻿using HDJ.Framework.Core;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace HDJ.Framework.Core
{
    public class GlobalEditorMonoEvent : EditorMonoBehaviour
    {

        public override void OnPlaymodeStateChanged(PlayModeStateChange playModeState)
        {
            //Debug.Log("OnPlaymodeStateChanged :" + playModeState);
            if (playModeState == PlayModeStateChange.EnteredEditMode)
            {
                ResourceManager.ReleaseAll();
                ResourceManager.LoadType = AssetsLoadType.Resources;

            }
            else if (playModeState == PlayModeStateChange.ExitingEditMode)
            {
                ResourceManager.ReleaseAll();
            }
            else if (playModeState == PlayModeStateChange.ExitingPlayMode)
            {
                ResourceManager.ReleaseAll();
            }
        }
    }
}
